-- GENERATED SPELL FOR [Kurenai Captive] --


function spell0_18209(pUnit, Event) --@Chain Lightning,n/a--
pUnit:FullCastSpellOnTarget(16006,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18209', 3000, 1)
end

function spell1_18209(pUnit, Event) --@Earthbind Totem,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(15786,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_18209', 1, 1)
end

function spell2_18209(pUnit, Event) --@Frost Shock,n/a--
pUnit:FullCastSpellOnTarget(12548,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18209', 8292, 1)
end

function spell3_18209(pUnit, Event) --@Healing Wave,Heal--
pUnit:FullCastSpellOnTarget(12491,pUnit)
pUnit:RegisterEvent('Sorts_18209', 3000, 1)
end

function Sorts_18209(pUnit, Event)
local choix_sorts_18209 = math.random(0, 3)
if choix_sorts_18209 == 0 then
pUnit:RegisterEvent('spell0_18209', 1, 1)
end
if choix_sorts_18209 == 1 then
pUnit:RegisterEvent('spell1_18209', 1, 1)
end
if choix_sorts_18209 == 2 then
pUnit:RegisterEvent('spell2_18209', 1, 1)
end
if choix_sorts_18209 == 3 then
pUnit:RegisterEvent('spell3_18209', 1, 1)
end
end

function mob18209_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18209', math.random(1500, 3000), 1)
end

function mob18209_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18209_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18209_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18209, 1, 'mob18209_Action')
RegisterUnitEvent(18209, 2, 'mob18209_Leave')
RegisterUnitEvent(18209, 3, 'mob18209_Kill')
RegisterUnitEvent(18209, 4, 'mob18209_Die')
